package com.husawang.husa.presenter.start;

import android.text.TextUtils;

import com.husawang.husa.lib.base.Global;
import com.husawang.husa.lib.base.MyApplication;
import com.husawang.husa.lib.base.utils.PreferenceHelper;
import com.husawang.husa.model.start.ISplashModel;
import com.husawang.husa.model.start.SplashModel;
import com.husawang.husa.lib.base.presenter.BasePresenter;
import com.husawang.husa.view.start.ISplashView;

/**
 * Created by s on 2017/8/8.
 */

public class SplashPresenter extends BasePresenter {

	private ISplashView mISplashView;
	private ISplashModel mISplashModel;


	public SplashPresenter(ISplashView mISplashView) {
		this.mISplashView = mISplashView;
		this.mISplashModel=new SplashModel();
	}

	/**
	 * 加载活动图
	 */
	public void loadADpic() {

		//是否有活动图
		String adPicData=PreferenceHelper.readString(MyApplication.getInstance(), Global.HUSA_CONFIG_FILE_NAME,Global.LAUNCH_PICTURE_NAME,"");
		if (!TextUtils.isEmpty(adPicData)){
			mISplashView.skipADpic();
		}else{
			mISplashView.skipHome();
		}

		mISplashModel.loadADpicSaveSP();

	}
}
